﻿#region Regions

using System;
using System.Text;

using Xceed.Compression;

#endregion

namespace FMWare.Core
{
	internal class Global
	{
		#region Declarations

		private const string DELIMITER = "\t";

		private struct Versions
		{
			#region Declarations

			public const short FM2009_9_0_0 = 1242;
			public const short FM2009_9_1_0 = 1243;
			public const short FM2009_9_2_0 = 1244;
			public const short FM2009_9_3_0 = 1245;

			#endregion
		}

		#endregion

		#region Internal Methods

		internal static void CheckSupportedVersion(short version)
		{
			if (Versions.FM2009_9_3_0 != version)
				throw new ApplicationException("Version not supported. You need FM 2009 Patch 3.");
		}

		internal static string CreateDelimitedString(params object[] data)
		{
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < data.Length; i++)
				stringBuilder.Append(data[i] + DELIMITER);
			stringBuilder.Length = stringBuilder.Length - DELIMITER.Length;
			return stringBuilder.ToString();
		}

		internal static void SetXCeedLicense()
		{
			Licenser.LicenseKey = "ZIN37-T76E3-6YFZ1-GGDA";
			Xceed.Compression.Formats.Licenser.LicenseKey = "ZIN37-T76E3-6YFZ1-GGDA";
		}

		#endregion
	}
}